package com.mh.controller;

import com.mh.dto.R;
import com.mh.pojo.PageElements;
import com.mh.service.PageElementService;
import com.mh.service.impl.PageElementServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Date:2024/10/19
 * author:zmh
 * description: 元素节点内容相关接口
 **/

@RestController
@RequestMapping("/pageElements")
@CrossOrigin
@Slf4j
@RequiredArgsConstructor
public class PageElementController {

    private final PageElementService pageElementService;

    /**
     * 根据展示位置获取元素节点内容数据
     * @param position 展示位置
     * @return 返回执行结果
     */
    @GetMapping("/getByPosition/{position}")
    public R<List<PageElements>> getPageElementsByPosition(@PathVariable String position){
        return pageElementService.getPageElementsByPosition(position);
    }

}
